package de.uni.muenster.idw2.autoverbal.data;

public class Coordinates implements Comparable<Coordinates>{
	private double x, y, floor;
	

	/**
	 * Constructor
	 * @param x The x coordinate
	 * @param y The y coordinate
	 */
	
	public Coordinates(double x, double y, double floor){
		setCoord(x, y, floor);
	}
	
	
	public double getX() {
		return x;
	}

	public void setX(double x) {
		this.x = x;
	}

	public double getY() {
		return y;
	}

	public void setY(double y) {
		this.y = y;
	}
	
	public double getFloor() {
		return floor;
	}


	public void setFloor(double floor) {
		this.floor = floor;
	}


	
	public void setCoord(double x, double y, double floor){
		setX(x);
		setY(y);
		setFloor(floor);
	}
	public double[] getCoord(){
		return new double[] {x,y, floor};
	}


	@Override
	public int compareTo(Coordinates c2) {
		// TODO Auto-generated method stub
		if(floor <c2.getFloor()){
			return -1;
		}
		else if (floor > c2.getFloor()){
			return 1;
		}
		else{
			if(x!=c2.getX() || y!=c2.getY()){
				return -1;
			}
			else{
				return 0;
			}
		}
	}
	
	
}
